<?php
/**
 * common model file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2019/08/20
 * Time: 06:01
 */

namespace HiCommon\Model;

class UserInvite extends Base
{
    
    protected $table = 'user_invite';
    
    protected $guarded = [];
    
    //public $timestamps = false;
    
    /**
     * 应该被调整为日期的属性
     *
     * @var array
     */
    protected $dates = [
    ];
    
    /**
     *  关联用户信息
     *  hinq 2019 08 29
     *
     **/
    public function getUser(){
        return $this->belongsTo(Users::class,'user_id','id')->select(['username','id','nickname','realname']);
    }
    public function getToUser(){
        return $this->belongsTo(Users::class,'to_user_id','id')->select(['username','id','nickname','realname', 'phone', 'head_img']);
    }
  
}